package com.huanhong.hik.bean;


import com.huanhong.hik.util.HCNetSDK;
import lombok.Data;

/**
 * 门禁
 *
 * @author zhls1
 */
@Data
public class AccessControl {
    /**
     * 用户句柄
     */
    private long userId = -1;
    /**
     * 报警布防句柄
     */
    private long lAlarmHandle = -1;

    private HCNetSDK hCNetSDK = HCNetSDK.INSTANCE;

    private HCNetSDK.NET_DVR_NETCFG_V30 mStrNetConfig;

    private HCNetSDK.NET_DVR_DEVICECFG_V40 devicecfg;

    /**
     * 报警监听句柄
     */
    private long listenHandle = -1;
    /**
     * 报警回调函数实现
     */
    private HCNetSDK.FMSGCallBack fMSFCallBack;
    /**
     * 报警回调函数实现
     */
    private HCNetSDK.FMSGCallBack_V31 fMSFCallBackV31;
    /**
     * GPS信息查询回调函数实现
     */
    private HCNetSDK.FGPSDataCallback fGpsCallBack;

    private HCNetSDK.FRemoteConfigCallback fRemoteCfgCallBackCardGet;
    private HCNetSDK.FRemoteConfigCallback fRemoteCfgCallBackCardSet;
    private HCNetSDK.FRemoteConfigCallback fRemoteCfgCallBackFaceGet;
    private HCNetSDK.FRemoteConfigCallback fRemoteCfgCallBackFaceSet;

    public AccessControl() {
        boolean initSuc = hCNetSDK.NET_DVR_Init();
        if (!initSuc) {
            throw new RuntimeException("初始化失败");
        }
    }

    private static class SingletonInstance {
        private static final AccessControl INSTANCE = new AccessControl();
    }

    public static AccessControl getInstance() {
        return SingletonInstance.INSTANCE;
    }


}
